<template>
  <div class="attention">
    <el-menu
      :default-active="activeIndex1"
      class="el-menu-demo"
      mode="horizontal"
      @select="handleSelect"
    >
      <el-menu-item index="1">
        <p class="ment-font">问题关注</p>
      </el-menu-item>
      <el-menu-item index="2">
        <p class="ment-font">用户关注</p>
        <p></p>
      </el-menu-item>
    </el-menu>
    <router-view></router-view>
  </div>
</template>
<script>
export default {
  name:"Attention",
  data() {
      return {
        activeIndex1: "1",
      };
    },created() {
    this.$router.push("/collect_issue");
  },
  watch: {
    activeIndex1(newValue, oldValue) {
      switch (newValue) {
        case "1":
          this.$router.push("/collect_issue");
          break;
        case "2":
          this.$router.push("/attention_user");
          break;
      }
    },
  },
  methods: {
    handleSelect(key, keyPath) {
      //   console.log(key, keyPath);
      this.activeIndex1 = key;
    },
  },
};
</script>
<style scoped>
.attention{
  /* border: 1px solid black; */
  width: 100%;
}
/* 重写导航栏字体的格式  **********************/
.ment-font {
  /* font-size: 15px; */
  color: black;
}
.el-menu--horizontal > .el-menu-item.is-active {
  font-weight: bold;
}
p{
  height: 10px;
}
</style>